import Router from 'koa-router';
import proxyService from '../../common/proxyService';
import { getFunctionAll, functionPurchase, getFunctionOpening } from '../../api';

const router = new Router();

// 获取功能列表
router.get('/getFunctionAll', async ctx => {
  const response = await proxyService.postProxy(ctx, getFunctionAll);
  return (ctx.body = response);
});

// 概况页获取功能列表
router.get('/getFunctionOpening', async ctx => {
  const response = await proxyService.postProxy(ctx, getFunctionOpening);
  return (ctx.body = response);
});
// 请求购买功能
router.get('/functionPurchase', async ctx => {
  const response = await proxyService.postProxy(ctx, functionPurchase);
  return (ctx.body = response);
});

export default router;
